<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学生管理系统</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="container">
        <!-- 登录界面 -->
        <div class="login-container" id="loginContainer">
            <form id="loginForm">
                <h2>登录</h2>
                <input type="text" id="username" placeholder="用户名">
                <input type="password" id="password" placeholder="密码">
                <button type="submit">登录</button>
                <p id="loginMessage"></p>
                <button type="button" onclick="showRegisterForm()">注册</button>
            </form>
        </div>

        <!-- 注册界面 -->
        <div class="register-container" id="registerContainer" style="display: none;">
            <form id="registerForm">
                <h2>注册</h2>
                <input type="text" id="registerUsername" placeholder="用户名">
                <input type="password" id="registerPassword" placeholder="密码">
                <button type="submit">注册</button>
                <p id="registerMessage"></p>
                <button type="button" onclick="showLoginForm()">返回登录</button>
            </form>
        </div>

        <!-- 操作界面 -->
        <div class="management-container" id="managementContainer" style="display: none;">
            <h2>学生管理</h2>
            <input type="text" id="searchStudent" placeholder="查找学生">
            <button onclick="searchStudent()">查找</button>
            <table>
                <thead>
                    <tr>
                        <th>学号</th>
                        <th>姓名</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody id="studentTableBody">
                </tbody>
            </table>
            <button onclick="showAddStudentForm()">增加学生</button>
        </div>

        <!-- 增加学生表单 -->
        <div class="add-student-container" id="addStudentContainer" style="display: none;">
            <form id="addStudentForm">
                <h2>增加学生</h2>
                <input type="text" id="addStudentId" placeholder="学号">
                <input type="text" id="addStudentName" placeholder="姓名">
                <button type="submit">增加</button>
                <p id="addStudentMessage"></p>
                <button type="button" onclick="showManagementForm()">返回管理</button>
            </form>
        </div>
    </div>
    <script src="script.js"></script>
</body>
</html>

